package 课工场练习;

public class Car extends Vehicle {
	// 型号
	private String type;

	public void setType(String type) {
		this.type = type;
	}

	public String getType() {
		return type;
	}

	public Car() {
	}

	// Car的带参构造方法
	public Car(String id, String brand, int perRent, String type) {
		super(id, brand, perRent);
		this.type = type;
	}

	// 重写父类的计算租金方法：根据自己的计算租金规则
	public double calcRent(int days) {
		double price = this.getPerRent() * days;
		if (days > 7 && days <= 30) {
			price *= 0.9;
		} else if (days > 30 && days <= 150) {
			price *= 0.8;
		} else if (days > 150) {
			price *= 0.7;
		}
		return price;
	}
}